package com.gper.edu.either

object ScalaEither {

  def divideMethod(number: Int,number2:Int):Either[String,Int]={
    if(number2 == 0) Left("the divide number is zero")
    else Right(number/number2)
  }
  def main(args: Array[String]): Unit = {
    val  result = divideMethod(2,1)
    result.left.map(s=>println(s))
    result.right.map(value => println(value))
  }
}
